package day240515.work;

import day240515.work.MyComparator;
import day240515.work.MySortUitl;
import day240515.work.Myint;

public class Test2 {
    public static void main(String[] args) {
//        int[] intArr=new int[]{3,5,1,2,9}
        Myint[] myIntArr=new Myint[]{new Myint(3),new Myint(5),new Myint(1),new Myint(2),new Myint(9)};
//        如何让int[] 可以传递到print（Object[]）
        MySortUitl.print(myIntArr);
        MySortUitl.sort(myIntArr, new MyComparator() {
            @Override
            public int compare(Object o1, Object o2) {
                Myint t1=(Myint) o1;
                Myint t2=(Myint) o2;
                if (t1.intValue()==t2.intValue()){
                    return 0;
                }if (t1.intValue()> t2.intValue()){
                    return 1;
                }else {
                    return -1;
                }

            }
        });
        MySortUitl.print(myIntArr);
        System.out.println("==== ==== ====");
        int i=3;
//        Myint myint=new Myint(3);
        Myint myint=Myint.valueOf(3);
//        myInt=i;
//        Object[]{object,object,object}


    }
}
